#include <VkSwapChain.hpp>

namespace NaturalEngine {
    VkSwapchain::VkSwapchain(const VkDevice &device, const i32 width, const i32 height) {
        Info = device.QuerySwapChainInfo(width, height, 2);
        vk::SwapchainCreateInfoKHR createInfo{};
        createInfo.setClipped(true)
                .setImageArrayLayers(1)
                .setImageUsage(vk::ImageUsageFlagBits::eColorAttachment)
                .setCompositeAlpha(vk::CompositeAlphaFlagBitsKHR::eOpaque)
                .setImageColorSpace(Info.Format.colorSpace)
                .setImageFormat(Info.Format.format)
                .setImageExtent(Info.ImageExtent)
                .setMinImageCount(Info.ImageCount)
                .setPresentMode(Info.Present);
        device.CreateSharedSwapchainKHR(SwapchainKHR, createInfo);
    }


    VkSwapchain::~VkSwapchain() {

    }

}
